const container = document.querySelector(".container");
const btn = document.querySelector(".btn");
const input = document.querySelector(".input")

btn.addEventListener("click", () => {
    if (input.value) {
        self.location = 'https://www.baidu.com/s?wd=' + input.value + '';
        input.value = "";
    }
    else {
        container.classList.toggle("active");
    }
    input.focus();
})